<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;

class OrdersController extends Controller
{
    public function buyCar(){
        $res=DB::table('buycar')->join('product','buycar.product_id','=','product.id')->get();
        $res=json_decode($res,true);
        if($res)
        {
            $request['code']=1;
            $request['msg']='查询成功';
            $request['data']=$res;
        }else{
            $request['code']=0;
            $request['msg']='查询失败';
            $request['data']='';
        }
        return $request;
    }
}
